package com.tma.android.gpm.data.database.util;


import com.tma.android.gpm.data.database.util.DatabaseTable.TableSongs;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHandler  extends SQLiteOpenHelper{

	private Context mContext;
	public DatabaseHandler(Context context) {
		super(context, DatabaseTable.DATABASE_NAME,null, DatabaseTable.DATABASE_VERSION);
		// TODO Auto-generated constructor stub
		this.mContext =context;
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		db.execSQL(TableSongs.CREATE_SONGS_TABLE);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		 db.execSQL("DROP TABLE IF EXISTS " + DatabaseTable.TABLE_SONGS);
		 onCreate(db);
	}

}
